.PHONY: build
build: clean db compile

.PHONY: db
db: db/schema.sql
	mysqladmin -u root -f drop petstore
	mysqladmin -u root -f create petstore
	mysql -u root petstore < db/schema.sql

.PHONY: compile
compile: build.beam
	erl -noshell -s build compile -s init stop

build.beam: build.erl
	erlc build.erl

.PHONY: clean
clean:
	-rm build.beam